// vuerouter使用的基本流程
// 1.安装vueRouter模块
// 2.配置路由⽂件
// 2.1 导入路由模块对象
import {createRouter, createWebHistory} from 'vue-router'
import Home from "@/views/HomeView.vue";
// 2.2. 创建路由对象
const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/', // 路由路径
            name: 'Home', // 路由名称
            component: Home, //  路由组件
        },
        {
            path: '/about',
            name: 'About',
            component: () => import('@/views/AboutView.vue'),
        },
        {
            path: '/search',
            name: "search",
            component: () => import('@/views/SearchView.vue'),
        },
        {
            path: '/search2/:keyword/:page',
            name: "search2",
            component: () => import('@/views/SearchView2.vue'),
        },
    ],
})
//2.3.导出路由对象
export default router

// 3.引入路由配置文件

// 4.在组件中使⽤路由

